package net.xiangcaowuyu.mybatis.controller;

import net.xiangcaowuyu.mybatis.entity.User;
import net.xiangcaowuyu.mybatis.service.UserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author laughing
 * @date 2020-10-17
 */
@RestController
@RequestMapping("user")
public class UserController {

    private final UserService userService;

    public UserController(UserService userService){
        this.userService=userService;
    }

    @RequestMapping("selectByPrimaryKey/{id}")
    public User selectByPrimaryKey(@PathVariable("id") Integer id) {
        return userService.selectByPrimaryKey(id);
    }

}
